<?php
session_start();
require_once 'header.php';
function __autoload($className)
	{
    	require_once('class/' . $className . '.class.php');
	}
session::need_member();
if(session::is_member()==TRUE)
{
	$UserId=session::getuserid();
	$GetTickets=database::LimitQuery('tickets',array(
	'select' => 'ticketid,subject,date,userid,closed',
	'condition' => array(
	'userid' => $UserId,
	),
	'order' => 'order by ticketid desc',
	'groupby' => 'group by ticketid'
	));
	require_once 'html/viewtickets.php';
}
else if(session::is_manager()==TRUE)
{
	$GetTickets=database::LimitQuery('tickets',array(
	'select' => 'ticketid,subject,date,userid,closed',
	'order' => 'order by ticketid desc',
	'condition' => array(
	'closed' => 0
	
	)
	));
	require_once 'html/viewtickets.php';
}

else 
{
	header('deneid.php');
}

?>